package entities;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Polygon;

public abstract class WorldEntity extends Entity {
	private int x;
	private int y;
	private int width;
	private int height;
	private int health;
	private Polygon polygon;
	private Color color;
	
	public abstract void draw(GameContainer gc, Graphics g);
	
	public WorldEntity(int x, int y, int width, int height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		
		polygon = new Polygon(new float[] {x, y,
										   x + width, y,
										   x + width, y + height,
										   x, y + height});
	}
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	public Polygon getPolygon() {
		return polygon;
	}
	public void setPolygon(Polygon polygon) {
		this.polygon = polygon;
	}
	public void updatePolygon() {
		polygon = new Polygon(new float[] {x, y,
				   x + width, y,
				   x + width, y + height,
				   x, y + height});
	}
	public Color getColor() {
		return color;
	}
	public void setColor(Color color) {
		this.color = color;
	}

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	}
}
